<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: IRTModel</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">IRTModel</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/irt_model_rb.html">
                irt_model.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">
    <div id="diagram">
      <map id="map" name="map">
  <area shape="rect" coords="5,5,85,53"      href="IRTModel.html" alt="IRTModel" />
</map>
<img src="../dot/f_5.png" usemap="#map" border="0" alt="dot/f_5.png">
    </div>

    <div id="description">
      <ul>
<li>irt_model.rb

</li>
<li>Copyright (C) 2010 Embian Inc.

<p>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
</p>
<p>
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
</p>
<p>
You should have received a copy of the GNU General Public License along
with This program. If not, see &lt;<a
href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/&gt;.
</p>
</li>
<li><a href="IRTModel.html">IRTModel</a> is a class to handle options of irt
model

</li>
<li>Author: KyoungMo Yang(E-mail : mo@embian.com)

</li>
<li>Modified: 2010-11-05

</li>
<li>References: N/A

</li>
</ul>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000068">_init_model</a>&nbsp;&nbsp;
      <a href="#M000069">_init_prior_for_parameters</a>&nbsp;&nbsp;
      <a href="#M000066">new</a>&nbsp;&nbsp;
      <a href="#M000067">use_dichotomous_model?</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">DICHOTOMOUS_1PL</td>
          <td>=</td>
          <td class="context-item-value">&quot;1PL&quot;</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">DICHOTOMOUS_2PL</td>
          <td>=</td>
          <td class="context-item-value">&quot;2PL&quot;</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">DICHOTOMOUS_3PL</td>
          <td>=</td>
          <td class="context-item-value">&quot;3PL&quot;</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">POLYTOMOUS_PCM</td>
          <td>=</td>
          <td class="context-item-value">&quot;PCM&quot;</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">POLYTOMOUS_GPCM</td>
          <td>=</td>
          <td class="context-item-value">&quot;GPCM&quot;</td>
        </tr>
        </table>
      </div>
    </div>



    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">D</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">model</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">points_of_ability</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">prior_a</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">prior_b</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">prior_c</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">range_of_ability</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">use_unique_points</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000066" class="method-detail">
        <a name="M000066"></a>

        <div class="method-heading">
          <a href="#M000066" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(new_model=IRTModel::DICHOTOMOUS_2PL)</span>
          </a>
        </div>
      
        <div class="method-description">
          <ul>
<li>Functionailities

</li>
</ul>
<pre>
 * Constructs an instance of IRTModel class and initializes options.
</pre>
<ul>
<li>Parameters

</li>
</ul>
<pre>
 * [new_model] : model name. default value is IRTModel::DICHOTOMOUS_2PL
</pre>
<ul>
<li>Return

</li>
</ul>
<pre>
 * An instance of IRTModel class
</pre>
<ul>
<li>Note

</li>
</ul>
<pre>
 * N/A
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000066-source">
<pre>
    <span class="ruby-comment cmt"># File irt_model.rb, line 40</span>
40:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">new_model</span>=<span class="ruby-constant">IRTModel</span><span class="ruby-operator">::</span><span class="ruby-constant">DICHOTOMOUS_2PL</span>)
41:     <span class="ruby-identifier">_init_model</span>(<span class="ruby-identifier">new_model</span>)
42:     <span class="ruby-identifier">_init_prior_for_parameters</span>
43:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000067" class="method-detail">
        <a name="M000067"></a>

        <div class="method-heading">
          <a href="#M000067" class="method-signature">
          <span class="method-name">use_dichotomous_model?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <ul>
<li>Functionailities

</li>
</ul>
<pre>
 * return value that indicates whether using dichotomous model.
</pre>
<ul>
<li>Parameters

</li>
</ul>
<pre>
 * N/A
</pre>
<ul>
<li>Return

</li>
</ul>
<pre>
 * if true, using dichotmomous model otherwise, return false
</pre>
<ul>
<li>Note

</li>
</ul>
<pre>
 * N/A
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000067-source">
<pre>
    <span class="ruby-comment cmt"># File irt_model.rb, line 53</span>
53:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">use_dichotomous_model?</span>
54:     <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@model</span> <span class="ruby-operator">==</span> <span class="ruby-constant">IRTModel</span><span class="ruby-operator">::</span><span class="ruby-constant">DICHOTOMOUS_1PL</span> <span class="ruby-operator">||</span>
55:       <span class="ruby-ivar">@model</span> <span class="ruby-operator">==</span> <span class="ruby-constant">IRTModel</span><span class="ruby-operator">::</span><span class="ruby-constant">DICHOTOMOUS_2PL</span> <span class="ruby-operator">||</span>
56:       <span class="ruby-ivar">@model</span> <span class="ruby-operator">==</span> <span class="ruby-constant">IRTModel</span><span class="ruby-operator">::</span><span class="ruby-constant">DICHOTOMOUS_3PL</span>)
57:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
58:     <span class="ruby-keyword kw">end</span>
59:     <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
60:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Private Instance methods</h3>

      <div id="method-M000068" class="method-detail">
        <a name="M000068"></a>

        <div class="method-heading">
          <a href="#M000068" class="method-signature">
          <span class="method-name">_init_model</span><span class="method-args">(new_model)</span>
          </a>
        </div>
      
        <div class="method-description">
          <ul>
<li>Functionailities

</li>
</ul>
<pre>
 * Initializes default model and options
</pre>
<ul>
<li>Parameters

</li>
</ul>
<pre>
 * [new_model] : model name
</pre>
<ul>
<li>Return

</li>
</ul>
<pre>
 * N/A
</pre>
<ul>
<li>Note

</li>
</ul>
<pre>
 * N/A
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000068-source">
<pre>
    <span class="ruby-comment cmt"># File irt_model.rb, line 74</span>
74:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_init_model</span>(<span class="ruby-identifier">new_model</span>)
75:     <span class="ruby-comment cmt">#mathmatical model, default is two-parameter logistic model</span>
76:     <span class="ruby-ivar">@model</span> = <span class="ruby-identifier">new_model</span>
77:     
78:     <span class="ruby-comment cmt">#range of ability(theta), default is from -4 to 4</span>
79:     <span class="ruby-ivar">@range_of_ability</span> = [<span class="ruby-value">-4</span>, <span class="ruby-value">4</span>]
80:     
81:     <span class="ruby-comment cmt">#number of ability points, default is 40 points </span>
82:     <span class="ruby-ivar">@points_of_ability</span> = <span class="ruby-value">40</span>
83:     
84:     <span class="ruby-comment cmt">#D is logistic scaling constant for 3PL</span>
85:     <span class="ruby-comment cmt">#(the default value 1.7 makes logistic courve, close to normal) </span>
86:     <span class="ruby-ivar">@D</span> = <span class="ruby-value">1.7</span>
87:     
88:     <span class="ruby-comment cmt">#if true, different points of ability(latent distribution points) are used for</span>
89:     <span class="ruby-comment cmt">#different examinee groups, default is false</span>
90:     <span class="ruby-comment cmt">#SEE : num_groups option of IRT class</span>
91:     <span class="ruby-ivar">@use_unique_points</span> = <span class="ruby-keyword kw">false</span>
92:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000069" class="method-detail">
        <a name="M000069"></a>

        <div class="method-heading">
          <a href="#M000069" class="method-signature">
          <span class="method-name">_init_prior_for_parameters</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <ul>
<li>Functionailities

</li>
</ul>
<pre>
 * Initializes default prior paramters
</pre>
<ul>
<li>Parameters

</li>
</ul>
<pre>
 * N/A
</pre>
<ul>
<li>Return

</li>
</ul>
<pre>
 * N/A
</pre>
<ul>
<li>Note

</li>
</ul>
<pre>
 * N/A
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000069-source">
<pre>
     <span class="ruby-comment cmt"># File irt_model.rb, line 102</span>
102:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_init_prior_for_parameters</span>
103:    <span class="ruby-comment cmt">#default prior used for dicrimination of item</span>
104:    <span class="ruby-ivar">@prior_a</span> = {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'beta'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value">1.75</span>, <span class="ruby-value">3.0</span>, <span class="ruby-value">0</span><span class="ruby-value">.0</span>, <span class="ruby-value">3.0</span>]}
105:    
106:    <span class="ruby-comment cmt">#default prior used for difficulty of item</span>
107:    <span class="ruby-ivar">@prior_b</span> = {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'beta'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value">1.01</span>, <span class="ruby-value">1.01</span>, <span class="ruby-value">-6.0</span>, <span class="ruby-value">6.0</span>]}
108:    
109:    <span class="ruby-comment cmt">#default prior used for guessing of item</span>
110:    <span class="ruby-ivar">@prior_c</span> = {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'beta'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value">3.5</span>, <span class="ruby-value">4.0</span>, <span class="ruby-value">0</span><span class="ruby-value">.0</span>, <span class="ruby-value">0</span><span class="ruby-value">.5</span>]}
111: 
112:     <span class="ruby-comment cmt">#default prior used for dicrimination of item</span>
113:     <span class="ruby-comment cmt"># @prior_a = {:type =&gt; 'beta', :value =&gt; [5.0, 17.0, 0.0, 1.0]}</span>
114:     <span class="ruby-comment cmt"># </span>
115:     <span class="ruby-comment cmt"># #default prior used for difficulty of item</span>
116:     <span class="ruby-comment cmt"># @prior_b = {:type =&gt; 'lognormal', :value =&gt; [0.0, 0.5]}</span>
117:     <span class="ruby-comment cmt"># </span>
118:     <span class="ruby-comment cmt"># #default prior used for guessing of item</span>
119:     <span class="ruby-comment cmt"># @prior_c = {:type =&gt; 'beta', :value =&gt; [1.01, 1.01, -6.0, 6.0]}</span>
120:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>